package com.olocat.cjx.nsims.pojo.permission

import javax.persistence.*

@Entity
@Table(name = "permission")
class Permission {

    @Id
    var id:Int = 0

    @Column(name = "role_id")
    var roleId: String? = null

    @Column(name = "permission_id")
    var permissionId: String? = null

    @Column(name = "permission_name")
    var permissionName: String? = null

    @OneToMany
    @JoinColumn(name = "permission_id")
    var actionEntitySet: Set<Action>? = null

    override fun toString(): String {
        return "Permission{" +
                "roleId='" + roleId + '\'' +
                ", permissionId='" + permissionId + '\'' +
                ", permissionName='" + permissionName + '\'' +
                ", actionEntitySet=" + actionEntitySet +
                '}'
    }
}